<!DOCTYPE html>
<html>
<head>
    <title>文章表 </title>
		<#include "/header.html">
</head>
<body>
<div id="webpage" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("news:news:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("news:news:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("news:news:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">

                    <div v-if="!1" class="form-group">
                        <div class="col-sm-2 control-label">分类编号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="news.categoryId" placeholder="分类编号"/>
                        </div>
                    </div>
                    <div v-if="!1" class="form-group">
                        <div class="col-sm-2 control-label">分类选择</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="news.categoryName" placeholder="分类名称 从系统参数获取"/>
                        </div>
                    </div>
                    <div v-if="" class="form-group">
                        <div class="col-sm-2 control-label">分类选择</div>
                        <div class="col-sm-10">
                            <div class="button-list" style="padding-top:5px;">
                                <span v-for="(v,k) in categories.list" @click="categories.value = v; news.categoryName = v;" :class="{'label-primary':categories.value == v}" class="label label-default">{{v}}</span>
                            </div>
                        </div>
                    </div>

											                    <div class="form-group">
                        <div class="col-sm-2 control-label">标题</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="news.title" placeholder="标题"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">内容</div>
                        <div class="col-sm-10">
                            <textarea style="width:100%;height:350px;" type="text" class="form-control" v-model="news.content" placeholder="资讯内容"></textarea>
                        </div>
                    </div>
                    <div v-if="!1" class="form-group">
                        <div class="col-sm-2 control-label">权重</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="news.rank" placeholder="权重 权重越高，越显示在前面，-1不显示"/>
                            <h6>权重越高，越显示在前面，-1不显示</h6>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">发布时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="news.publishDate" placeholder="发布时间 当前时间大于发布时间，才会展示"/>
                            <h6>当前时间大于发布时间，才会展示</h6>
                        </div>
                    </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<script>
    set_grid_column_formatter('news/news/id',function (cellValue , options , rowData) {
        return cellValue;
    })
</script>
<script src="${request.contextPath}/statics/js/modules/news/news.js?_${.now?long}"></script>
</body>
</html>